package HomeWork.Extends_05;

public class Computer {

    public void USBConnect(USB usb) {
        if (usb instanceof Mouse m){
            m.connect();
        }
        if (usb instanceof KeyBoard k){
            k.connect();
        }
    }

    public void USBDisconnect(USB usb) {
        if (usb instanceof Mouse m){
            m.disconnect();
        }
        if (usb instanceof KeyBoard k){
            k.disconnect();
        }
    }

    public void start() {
        System.out.println("笔记本开机");
    }

    public void shutdown(){
        System.out.println("笔记本关机");
    }
}
